package com.system.healthproject.model.sickuser.service.imp;

import com.system.healthproject.mapper.VisitRecordsMapper;
import com.system.healthproject.model.admin.paramsbean.VisitRecordsParams;
import com.system.healthproject.model.sickuser.service.VisitRecordsService;
import com.system.healthproject.pojo.VisitRecords;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class VisitRecordsServiceImp implements VisitRecordsService {

    @Autowired
    VisitRecordsMapper visitRecordsMapper;


    /**
     * 患者添加就诊记录
     * @param addRecordParamss
     * @param loginId
     * @return
     */
    @Override
    public boolean addVisitRecords(VisitRecordsParams addRecordParamss, Integer loginId) {
        VisitRecords record = new VisitRecords();
        record.setHospitalName(addRecordParamss.getHospitalName());
        record.setDoctorName(addRecordParamss.getHospitalName());
        record.setVisitrecordstime(addRecordParamss.getVisitrecordstime());
        record.setVisitrecordsText(addRecordParamss.getVisitrecordsText());
        record.setVisitrecordsImgs(addRecordParamss.getVisitrecordsImgs());
        record.setVisitRecordsType(2);
        record.setPatientId(loginId);
        int insert = visitRecordsMapper.insert(record);
        return insert==1;
    }
}
